import { createRouter, createWebHistory } from 'vue-router'
import LoginPage from '../views/LoginPage.vue'
import MainPage from '../views/MainPage.vue'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
	path: '/',
    name: 'login',
    component: LoginPage
  },
  {
  	path:'/Preview',
  	name:'Preview',
  	component:()=>import('@/views/Preview.vue')
  },
  {
    path: '/main',
    name: 'main',
    component: MainPage,
    children: [
	  {
        path: '',
        name: 'HomeView',
        component:HomeView
      },{
        path: 'Personal',
        name: 'Personal',
        component:()=>import('@/views/Personal.vue')
      },{
        path: 'Password',
        name: 'Password',
        component:()=>import('@/views/Password.vue')
      },{
		path:'MainSetting1',
		name:'MainSetting1',
		component:()=>import('@/views/MainSetting1.vue')
	  },{
		path:'MainSetting2',
		name:'MainSetting2',
		component:()=>import('@/views/MainSetting2.vue')
	  },{
		path:'MainSetting3',
		name:'MainSetting3',
		component:()=>import('@/views/MainSetting3.vue')
	  },{
		path:'MainSetting4',
		name:'MainSetting4',
		component:()=>import('@/views/MainSetting4.vue')
	  },{
		path:'MainMini1',
		name:'MainMini1',
		component:()=>import('@/views/MainMini1.vue')
	  },{
		path:'MainMini2',
		name:'MainMini2',
		component:()=>import('@/views/MainMini2.vue')
	  },{
		path:'MainMerchant1',
		name:'MainMerchant1',
		component:()=>import('@/views/MainMerchant1.vue')
	  },{
		path:'MainMerchant2',
		name:'MainMerchant2',
		component:()=>import('@/views/MainMerchant2.vue')
	  },{
		path:'MainMerchant3',
		name:'MainMerchant3',
		component:()=>import('@/views/MainMerchant3.vue')
	  },{
		path:'MainCase2',
		name:'MainCase2',
		component:()=>import('@/views/MainCase2.vue'),
		children: [
			{path: 'doc1802',name: 'doc1802',component: ()=>import('@/views/mainCase/doc1802.vue')},
			{path: 'doc1812',name: 'doc1812',component: ()=>import('@/views/mainCase/doc1812.vue')},
			{path: 'doc1822',name: 'doc1822',component: ()=>import('@/views/mainCase/doc1822.vue')},
			{path: 'doc1832',name: 'doc1832',component: ()=>import('@/views/mainCase/doc1832.vue')}
			
		]
	  },{
		path:'MainCase3',
		name:'MainCase3',
		component:()=>import('@/views/MainCase3.vue'),
		children: [
			{path: 'doc1813',name: 'doc1813',component: ()=>import('@/views/mainCase/doc1813.vue')},
			{path: 'doc1823',name: 'doc1823',component: ()=>import('@/views/mainCase/doc1823.vue')},
			{path: 'doc1833',name: 'doc1833',component: ()=>import('@/views/mainCase/doc1833.vue')}
		]
	  },{
		path:'MainCase4',
		name:'MainCase4',
		component:()=>import('@/views/MainCase4.vue'),
		children: [
			{path: 'doc1803',name: 'doc1803',component: ()=>import('@/views/mainCase/doc1803.vue')},
			{path: 'doc1814',name: 'doc1814',component: ()=>import('@/views/mainCase/doc1814.vue')},
			{path: 'doc1824',name: 'doc1824',component: ()=>import('@/views/mainCase/doc1824.vue')},
			{path: 'doc1825',name: 'doc1825',component: ()=>import('@/views/mainCase/doc1825.vue')},
			{path: 'doc1834',name: 'doc1834',component: ()=>import('@/views/mainCase/doc1834.vue')}
		]
	  },{
		path:'MainCase5',
		name:'MainCase5',
		component:()=>import('@/views/MainCase5.vue')
	  },{
		path:'MainCase6',
		name:'MainCase6',
		component:()=>import('@/views/MainCase6.vue')
	  },{
		path:'MainCase1',
		name:'MainCase1',
		component:()=>import('@/views/MainCase1.vue'),
		children: [
			{path: 'doc001',name: 'doc001',component: ()=>import('@/views/mainCase/doc001.vue')},
			{path: 'doc003',name: 'doc003',component: ()=>import('@/views/mainCase/doc003.vue')},
			{path: 'doc004',name: 'doc004',component: ()=>import('@/views/mainCase/doc004.vue')},
			{path: 'doc006',name: 'doc006',component: ()=>import('@/views/mainCase/doc006.vue')},
			{path: 'doc008',name: 'doc008',component: ()=>import('@/views/mainCase/doc008.vue')},
			{path: 'doc102',name: 'doc102',component: ()=>import('@/views/mainCase/doc102.vue')},
			{path: 'doc103',name: 'doc103',component: ()=>import('@/views/mainCase/doc103.vue')},
			{path: 'doc104',name: 'doc104',component: ()=>import('@/views/mainCase/doc104.vue')},
			{path: 'doc105',name: 'doc105',component: ()=>import('@/views/mainCase/doc105.vue')},
			{path: 'doc106',name: 'doc106',component: ()=>import('@/views/mainCase/doc106.vue')},
			{path: 'doc128',name: 'doc128',component: ()=>import('@/views/mainCase/doc128.vue')},
			{path: 'doc151',name: 'doc151',component: ()=>import('@/views/mainCase/doc151.vue')},
			{path: 'doc152',name: 'doc152',component: ()=>import('@/views/mainCase/doc152.vue')},
			{path: 'doc153',name: 'doc153',component: ()=>import('@/views/mainCase/doc153.vue')},
			{path: 'doc154',name: 'doc154',component: ()=>import('@/views/mainCase/doc154.vue')},
			{path: 'doc201',name: 'doc201',component: ()=>import('@/views/mainCase/doc201.vue')},
			{path: 'doc203',name: 'doc203',component: ()=>import('@/views/mainCase/doc203.vue')},
			{path: 'doc204',name: 'doc204',component: ()=>import('@/views/mainCase/doc204.vue')},
			{path: 'doc205',name: 'doc205',component: ()=>import('@/views/mainCase/doc205.vue')},
			{path: 'doc207',name: 'doc207',component: ()=>import('@/views/mainCase/doc207.vue')},
			{path: 'doc209',name: 'doc209',component: ()=>import('@/views/mainCase/doc209.vue')},
			{path: 'doc211',name: 'doc211',component: ()=>import('@/views/mainCase/doc211.vue')},
			{path: 'doc301',name: 'doc301',component: ()=>import('@/views/mainCase/doc301.vue')},
			{path: 'doc309',name: 'doc309',component: ()=>import('@/views/mainCase/doc309.vue')},
			{path: 'doc310',name: 'doc310',component: ()=>import('@/views/mainCase/doc310.vue')},
			{path: 'doc402',name: 'doc402',component: ()=>import('@/views/mainCase/doc402.vue')}
		]
	  }
     ]
  },
  {
	  
	path: '/:catchAll(.*)',
    name: '404',
    component: ()=>import('@/views/error404.vue')
  }
]


/* const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
}) */
const router = createRouter({
  routes,
  history: createWebHistory(process.env.BASE_URL),
  scrollBehavior() {//当切换到新路由时，想要页面滚到顶部，或者是保持原先的滚动位置
    return { top: 0 }
  }
})

export default router
